<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('单位专家转移')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row" id="zhuanjiazhuanyi">

            <input name="deptid" th:value="${session.deptid}" type="hidden" id="deptid">
            <input name="olddeptid" th:value="${session.olddeptid}" type="hidden" id="olddeptid">
            <input name="id" th:value="${id}" type="hidden" id="id">

            <div class="col-sm-12 search-collapse">
                <div class="col-sm-6">
                    <form>
                        <div class="select-list">
                            <ul>
                                <li>
                                    <label>姓名：</label>
                                    <input type="text" name="xingming" v-model="xingming"/>
                                </li>
                                <li>
                                    <a class="btn btn-primary btn-rounded btn-sm" @click="bindZhuanjiaList"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                    <a class="btn btn-warning btn-rounded btn-sm" @click=""><i class="fa fa-refresh"></i>&nbsp;重置</a>
                                </li>
                            </ul>
                        </div>
                    </form>
                </div>
                <div class="col-sm-6">
                    <form>
                        <div class="select-list">
                            <ul>
                                <li>
                                    <label>单位名称：</label>
                                    <input type="text" name="jigoumingcheng" v-model="jigoumingcheng"/>
                                </li>
                                <li>
                                    <label>机构代码：</label>
                                    <input type="text" name="jigoudaima" v-model="jigoudaima"/>
                                </li>
                                <li>
                                    <a class="btn btn-primary btn-rounded btn-sm" @click="bindDeptList"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                    <a class="btn btn-warning btn-rounded btn-sm" @click=""><i class="fa fa-refresh"></i>&nbsp;重置</a>
                                </li>
                            </ul>
                        </div>
                    </form>
                </div>
            </div>

            <div class="col-sm-12 select-table table-striped">
                <div class="col-sm-6" style="padding:20px 10px 0px 10px">
                    <div style="float:left;width:200px;height:34px;line-height:34px;font-size:18px;font-weight: bold;margin-bottom:10px;">单位专家</div>
                    <table class="table table-hover table-primary table-striped">
                        <thead>
                        <tr style="font-weight: bold;height:50px;line-height:50px;">
                            <th style="text-align: center; vertical-align: middle;width:50px;">序号</th>
                            <th style="text-align: center; vertical-align: middle; width:100px;"><input type="checkbox" id="zhuanjia_ckb_all">全选</th>
                            <th style="text-align: center; vertical-align: middle;">专家姓名</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr v-for="(zhuanjiaitem,index) in zhuanjialist"  v-if="zhuanjialist.length > 0">
                            <td style="vertical-align: middle; text-align: center;" v-text="index+1"></td>
                            <td style="vertical-align: middle; text-align: center;"><input type="checkbox" name="zhuanjia_ckb" :value="zhuanjiaitem.zhuanjiaid"></td>
                            <td style="vertical-align: middle; text-align: center;" v-text="zhuanjiaitem.xingming"></td>
                        </tr>
                        <tr v-if="zhuanjialist.length == 0">
                            <td style="text-align: center; vertical-align: middle" colspan="3">查无数据</td>
                        </tr>
                        </tbody>
                    </table>
                </div>
                <div class="col-sm-6" style="padding:20px 10px 0px 10px">
                    <div style="float:left;width:200px;height:34px;line-height:34px;font-size:18px;font-weight: bold">下级单位</div>
                    <button class="btn btn-success btn-rounded btn-md" @click="zhuanyi(olddeptid)" style="float:right;margin-bottom: 10px;">转移至本单位</button>
                    <table class="table table-hover table-primary table-striped">
                        <thead>
                        <tr style="font-weight: bold;height:50px;line-height:50px;">
                            <th style="text-align: center; vertical-align: middle;width:50px;">序号</th>
                            <th style="text-align: center; vertical-align: middle;">单位名称</th>
                            <th style="text-align: center; vertical-align: middle;">操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr v-for="(deptitem,index) in deptlist"  v-if="deptlist.length > 0">
                            <td style="vertical-align: middle; text-align: center;" v-text="index+1"></td>
                            <td style="vertical-align: middle; text-align: center;" v-text="deptitem.jigoumingcheng"></td>
                            <td style="vertical-align: middle; text-align: center;">
                                <button class="btn btn-default btn-rounded btn-sm" @click="zhuanyi(deptitem.id)">转移</button>
                            </td>
                        </tr>
                        <tr v-if="deptlist.length == 0">
                            <td style="text-align: center; vertical-align: middle" colspan="3">查无数据</td>
                        </tr>
                        </tbody>
                    </table>
                </div>

            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
     <script th:src="@{/js/system/deptzhuanjia/zhuanjiazhuanyi.js?v=1.1}"></script>
    <script>
        $("#zhuanjia_ckb_all").on("click",function(){
            if($(this).is(':checked')){
                $('input[name="zhuanjia_ckb"]').each(function(){
                    $(this).prop("checked",true);
                });
            }else{
                $('input[name="zhuanjia_ckb"]').each(function(){
                    $(this).prop("checked",false);
                });
            }
        });
    </script>
</body>
</html>